package com.gopay.bis.service.bank.impl;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.gopay.common.Result;
import com.gopay.common.constants.proccode.ProcCodeConstants;
import com.gopay.common.domain.bank.ExPayBaseMessage;
import com.gopay.common.util.spring.SpringContextUtil;
import com.gopay.remote.bank.AdjustInteractRemoteService;
/**
 * 银盛代扣对账单对外接口
 * @BankAdjustInteractServiceImpl.java
 * @author lilili
 * @2016年6月7日 下午5:41:11  www.gopay.com.cn Inc.All rights reserved.
 */
@Service("adjustInteractService")
public class BankAdjustInteractServiceImpl implements AdjustInteractRemoteService{

	private static Logger logger = LoggerFactory.getLogger(BankAdjustInteractServiceImpl.class);
	
	@Override
	public Result adjust(ExPayBaseMessage baseMsg) {
		
		logger.error("BankAdjustInteractServiceImpl银盛代扣对账单处理base对象："+ToStringBuilder.reflectionToString(baseMsg));
        Result result = new Result();
        try{
        	AdjustInteractRemoteService adjustService = (AdjustInteractRemoteService)SpringContextUtil.getBean("YSPAY-EXPAY");
        	result= adjustService.adjust(baseMsg);
		  logger.error("BankAdjustInteractServiceImpl银盛代扣对账单请求返回处理对象："+ToStringBuilder.reflectionToString(result));
	    } catch (Exception e) {
	        logger.error("BankAdjustInteractServiceImpl adjust error: ", e);
	        result.setResultCode(ProcCodeConstants.PROC_CODE_100F1002);
	        result.setSuccess(false);
	    }
    return result;
	}

}
